﻿@namespace BootstrapBlazor.Components
@inherits CardBase

<div @attributes="@AdditionalAttributes" class="@ClassName">
    @if (CardHeader != null || !string.IsNullOrEmpty(HeaderText))
    {
        <div class="card-header">
            @if (IsCollapsible)
            {
                <div class="@HeaderClassString" data-bs-collapsed="@CollapsedString" @ref="CardElement">
                    <i class="card-collapse-arrow fa-solid fa-circle-chevron-right"></i>
                    <div class="card-collapse-body">
                        @if (CardHeader != null)
                        {
                            @CardHeader
                        }
                        else
                        {
                            @HeaderText
                        }
                    </div>
                </div>
            }
            else
            {
                if (CardHeader != null)
                {
                    @CardHeader
                }
                else
                {
                    @HeaderText
                }
            }
        </div>
    }
    <div class="@BodyClassName" style="@CardBodyStyleString">
        @CardBody
    </div>
    @if (CardFooter != null)
    {
        <div class="@FooterClassName">
            @CardFooter
        </div>
    }
</div>
